package monitor;

public class ServerConnection implements Comparable<ServerConnection> {

	String host;
	int port;

	public ServerConnection(String host, int port) {
		super();
		this.host = host;
		this.port = port;
	}

	public String getHost() {
		return host;
	}

	public int getPort() {
		return port;
	}

	@Override
	public int compareTo(ServerConnection o) {
		int result = host.compareTo(o.getHost());

		if (result == 0) {
			result = o.getPort() - port;
		}

		return result;
	}

}
